tiny memory leaks
authorparkrrrr <parkrrrr>
Tue, 3 May 2005 16:41:06 +0000 (16:41 +0000)
committerparkrrrr <parkrrrr>
Tue, 3 May 2005 16:41:06 +0000 (16:41 +0000)
html.c
vcf.c

diff --git a/html.c b/html.c
index 0b4c5dcbfb5193161befcc6fe55b81cd08230a66..ab72d1c4980cd92184be5b0b248615a8a5ebdb41 100644 (file)
--- a/html.c
+++ b/html.c
@@ -104,10 +104,14 @@ html_disp(const waypoint *wpt)
        }
        if (wpt->gc_data.terr) {
                if (wpt->gc_data.desc_short.utfstring) {
-                       fprintf (file_out, "<p class=\"descshort\">%s</p>\n", strip_nastyhtml(wpt->gc_data.desc_short.utfstring));
+                       char *tmpstr = strip_nastyhtml(wpt->gc_data.desc_short.utfstring);
+                       fprintf (file_out, "<p class=\"descshort\">%s</p>\n", tmpstr );
+                       xfree( tmpstr );
                        }
                if (wpt->gc_data.desc_long.utfstring) {
-                       fprintf (file_out, "<p class=\"desclong\">%s</p>\n", strip_nastyhtml(wpt->gc_data.desc_long.utfstring));
+                       char *tmpstr = strip_nastyhtml(wpt->gc_data.desc_long.utfstring);
+                       fprintf (file_out, "<p class=\"desclong\">%s</p>\n", tmpstr );
+                       xfree( tmpstr );
                        }
                if (wpt->gc_data.hint) {
                        char *hint = NULL;
diff --git a/vcf.c b/vcf.c
index 64fb45cc1f37b4ebe2b1b5705ac55aafc9329193..aa6911accc66370c7a09592bf781f2a8b60f01cd 100644 (file)
--- a/vcf.c
+++ b/vcf.c
@@ -70,6 +70,7 @@ vcf_print_utf(const utf_string *s)
        fputs(p2, file_out);
        xfree(p);
        xfree(p2);
+       xfree(stripped_html);
 }
 
 static void